<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:fragment="mediaBody">
<head>
    <link rel="stylesheet" th:href="@{lib/oss-upload/oss-upload-style.css}" />
    <style type="text/css">
        .header2-3 {
            width: 180px;
            margin-top: 2px;
        }
    </style>
</head>
<body style="overflow-x: hidden;">
<input type="hidden" id="currentUploadDir" value="" th:attr="value=${currentUploadDir}"/>

<!-- right header -->
<div class="container-fluid right-header header-bg">
    <!-- right content header -->
    <div class="header2">
        <div class="header2-1">
            <nav aria-label="breadcrumb">
                <ol th:if="${breadcrumb == null}" class="breadcrumb mr-auto header-bg" style="margin-bottom: 0;">
                    <li class="breadcrumb-item active">&nbsp;</li>
                </ol>
                <ol th:if="${breadcrumb != null}" class="breadcrumb mr-auto header-bg" style="margin-bottom: 0;">
                    <li class="breadcrumb-item active"><span th:text="${breadcrumb[0]}"></span></li>
                    <li class="breadcrumb-item active"><span th:text="${breadcrumb[1]}"></span></li>
                    <li class="breadcrumb-item active"><span th:text="${breadcrumb[2]}"></span></li>
                    <li class="breadcrumb-item active"><span th:text="${breadcrumb[3]}"></span></li>
                </ol>
            </nav>
        </div>
        <!--<div class="header2-3">
            <a id="mgrfiles" href="javascript:mgrfiles();" class='oss-btn'>文件上传</a>
        </div>-->
    </div>
</div>
<!-- right content body -->
<div id="mediaBody" class="right-body" th:if="${mediaType == 'image'}">
    <div th:replace="imageBody::imageBody"></div>
</div>
<div id="mediaBody" class="right-body" th:if="${mediaType == 'video'}">
    <div th:replace="videoBody::videoBody"></div>
</div>
<div id="mediaBody" class="right-body" th:if="${mediaType == 'pdf'}">
    <div th:replace="pdfBody::pdfBody"></div>
</div>
<div id="mediaBody" class="right-body" th:if="${mediaType == 'mgr'}">
    <div th:replace="mgrBody::mgrBody"></div>
</div>
<div id="mediaBody" class="right-body-main background" th:if="${mediaType == 'index' or mediaType == 'unknown'}"></div>
</body>
<script th:inline="javascript">
    function mgrfiles(){
        // alert($("#currentUploadDir").val());
        if(check()){
            $.ajax({
                url:'/mgr/getMediaMgr',
                type:'POST',
                async:true,
                data:{
                    currentUploadDir:$("#currentUploadDir").val()
                },
                dataType:'html',
                success:function(data){
                    $("#right-content").html(data);
                }
            });
        }

    }
    function check() {
        var currentApplNo = $("#currentApplNo").val();
        if (currentApplNo == "") {
            alert("请查询订单后再上传文件。");
            return false;
        }

        var currentUploadDir = $("#currentUploadDir").val();
        if (currentUploadDir == "") {
            alert("请选择文件夹后再上传文件。");
            return false;
        }
        return true;
    };
</script>
</html>